package cn.qzzg.springcloud;

import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {
    @Resource
    private ServletWebServerApplicationContext context;


    @GetMapping("/getUserName")
    public String getUserName(){
       return "user-provider port:" + context.getWebServer().getPort();
    }

    @GetMapping("/getUserInfo")
    public String getUserInfo(String username,String password){
        return "username:"+username+" password:"+password +" port:"+ context.getWebServer().getPort();
    }
}
